package com.lbd.gulimall.order.web;

import com.lbd.gulimall.order.service.OrderService;
import com.lbd.gulimall.order.vo.OrderConfirmVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.concurrent.ExecutionException;

/**
 * @Author: linbd
 * @Description:
 * @Date: 2023/3/26 3:36
 */
@Controller
public class OrderIndexController {
    @Autowired
    private OrderService orderService;
    @GetMapping("/{page}.html")
    public String listPage(@PathVariable("page") String page) {
        return page;
    }

    @GetMapping("/toTrade")
    public String toTrade(Model model) throws ExecutionException, InterruptedException {
        OrderConfirmVO orderConfirmVO = orderService.getOrderConfirmInfo();
        model.addAttribute("item",orderConfirmVO);
        return "confirm";
    }
}
